From: Andrew Garrett Date: Sat, 31 Jan 2009 01:59:13 +0000 (+0000) Subject: Allow af_public_comments to be wikitext. X-Git-Tag: 1.31.0-rc.0~43108 X-Git-Url: http://git.cyclocoop.org/%28%5B%5E/404?a=commitdiff_plain;h=ed8623d1138f71df3504d47f465ac6b311342a96;p=lhc%2Fweb%2Fwiklou.git Allow af_public_comments to be wikitext. Relatedly, add parseInline function to OutputPage, to avoid duplicating the same awful regex in wfMsgExt. --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 2c0d617a2e..f50d0fdebb 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -645,6 +645,18 @@ class OutputPage { return $parserOutput->getText(); } + /** Parse wikitext, strip paragraphs, and return the HTML. */ + public function parseInline( $text, $linestart = true, $interface = false ) { + $parsed = $this->parse( $text, $linestart, $interface ); + + $m = array(); + if ( preg_match( '/^

(.*)\n?<\/p>\n?/sU', $parsed, $m ) ) { + $parsed = $m[1]; + } + + return $parsed; + } + /** * @param Article $article * @param User $user